home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snip9611.zip / SNIPMATH.H < prev    next >
C/C++ Source or Header  |  1996-11-24  |  3KB  |  69 lines

  1. /* +++Date last modified: 03-Nov-1996 */
  2.  
  3. /*
  4. **  SNIPMATH.H - Header file for SNIPPETS math functions and macros
  5. */
  6.  
  7. #ifndef SNIPMATH__H
  8. #define SNIPMATH__H
  9.  
  10. #include <math.h>
  11. #include "sniptype.h"
  12. #include "round.h"
  13.  
  14. /*
  15. **  Callable library functions begin here
  16. */
  17.  
  18. void    SetBCDLen(int n);                             /* Bcd.C          */
  19. long    BCDtoLong(char *BCDNum);                      /* Bcd.C          */
  20. void    LongtoBCD(long num, char BCDNum[]);           /* Bcd.C          */
  21. DWORD   ncomb1 (int n, int m);                        /* Combin.C       */
  22. DWORD   ncomb2 (int n, int m);                        /* Combin.C       */
  23. void    SolveCubic(double a, double b, double c,      /* Cubic.C        */
  24.                   double d, int *solutions,
  25.                   double *x);
  26. DWORD   dbl2ulong(double t);                          /* Dbl2Long.C     */
  27. long    dbl2long(double t);                           /* Dbl2Long.C     */
  28. double  dround(double x);                             /* Dblround.C     */
  29.  
  30. /* Use #defines for Permutations and Combinations     -- Factoryl.C     */
  31.  
  32. #define log10P(n,r) (log10factorial(n)-log10factorial((n)-(r)))
  33. #define log10C(n,r) (log10P((n),(r))-log10factorial(r))
  34.  
  35. double  log10factorial(double N);                     /* Factoryl.C     */
  36.  
  37. double  fibo(unsigned short term);                    /* Fibo.C         */
  38. double  frandom(int n);                               /* Frand.C        */
  39. double  ipow(double x, int n);                        /* Ipow.C         */
  40. int     ispow2(int x);                                /* Ispow2.C       */
  41. long    double ldfloor(long double a);                /* Ldfloor.C      */
  42. float   MSBINToIEEE(float f);                         /* Msb2Ieee.C     */
  43. float   IEEEToMSBIN(float f);                         /* Msb2Ieee.C     */
  44. int     perm_index (char pit[], int size);            /* Perm_Idx.C     */
  45. int     round_div(int n, int d);                      /* Rnd_Div.C      */
  46. long    round_ldiv(long n, long d);                   /* Rnd_Div.C      */
  47. double  rad2deg(double rad);                          /* Rad2Deg.C      */
  48. double  deg2rad(double deg);                          /* Rad2Deg.C      */
  49.  
  50. #include "pi.h"
  51. #ifndef PHI
  52.  #define PHI      ((1.0+sqrt(5.0))/2.0)         /* the golden number    */
  53.  #define INV_PHI  (1.0/PHI)                     /* the golden ratio     */
  54. #endif
  55.  
  56. /*
  57. **  File: ISQRT.C
  58. */
  59.  
  60. struct int_sqrt {
  61.       unsigned sqrt,
  62.                frac;
  63. };
  64.  
  65. void usqrt(unsigned long x, struct int_sqrt *q);
  66.  
  67.  
  68. #endif /* SNIPMATH__H */
  69.